const jwt = require('jsonwebtoken');
const secret = 'zbw';

module.exports = {
    createToken: (param) => jwt.sign({ name: param }, secret, { expiresIn:  86400 }),
    getTokenInfo: (param) => jwt.verify(param, secret, function (err, decoded) { if (!err){ console.log(decoded.name); }})
}